var server = require('../../utils/server');
Page({
	data:{
    keywords:'',
  },
	search:function(e){

        var keywords = this.data.keywords;
        wx.navigateTo({
            url: "../goods/list/list?keywords=" + keywords
        });
		//nihao

	},
	bindChange: function(e) {
		
		var keywords = e.detail.value;
		
		this.setData({
			keywords: keywords
		});
	},
	onLoad:function(option)
	{
		var that = this
    
    // server.getJSON('/site/headwd',function(res){
      
    //   var keyword = res.data.list;
		//     that.setData({keyword:keyword});

		// });
    server.send('/site/headwd','POST',{}).then(res=>{
      var keyword = res.list;
		    that.setData({keyword:keyword});
    })
		
	},
	click:function(e)
	{
        var keywords = e.currentTarget.dataset.word.wd
    // console.log(keywords)
        wx.navigateTo({
            url: "../../../../goods/list/list?keywords=" + keywords
        });
	}
})